import java.util.HashSet;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        String[] arr=new String[]{"void", "main", "int", "printf", "if", "for"};
        String str=in.nextLine();
        HashSet<Integer> hash=new HashSet<>();
        for(int i = 0;i < str.length() - 1;i++){
            StringBuilder s=new StringBuilder();
            while((i <str.length() - 1)&&(str.charAt(i) != '#')&&(str.charAt(i) >= 'a'&&str.charAt(i) <= 'z'||str.charAt(i) >= 'A'&&str.charAt(i) <= 'Z')){
                s.append(str.charAt(i++));
            }
            for(int j = 0;j < arr.length;j++){
                if(arr[j].equals(s.toString())){
                    if(!hash.contains(j)){
                        hash.add(j);
                        System.out.println(j + 1 + "  " + arr[j]);
                    }
                }
            }
        }
    }
}